<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SSD1306Ascii: Arduino SSD1306Ascii Library</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SSD1306Ascii
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Arduino SSD1306Ascii Library </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><center>Copyright &copy; 2015-20018 by William Greiman </center><h1><a class="anchor" id="Intro"></a>
Introduction</h1>
<p>The Arduino SSD1306Ascii Library is designed to display text on small monochrome OLED displays. These displays are available on ebay at very low cost.</p>
<p>The library is being developed using 0.96" and 1.3" displays with SSD1306 controllers. An initialization sequence for SH1106 controllers is included.</p>
<p>There are many existing full featured graphics libraries for these displays. The goal for this library is to only display text with minimum use of RAM and flash.</p>
<p>Here are key design goals:</p>
<p>Small size is the highest priority. Speed and features are lower priority.</p>
<p>Support multiple fonts. More than 40 fonts are included with this release. Fonts are only loaded if you reference them.</p>
<p>Support fixed width and proportional fonts.</p>
<p>Optionally magnify fonts by a factor of two.</p>
<p>Support 128x32 and 128x64 displays with I2C and SPI interfaces.</p>
<p>Use the standard Wire library for I2C. An optimization option is available to increase I2C performance.</p>
<p>Use the standard SPI library for hardware SPI.</p>
<p>Provide software SPI so the display can be connected to any digital pins.</p>
<p>A small AVR only I2C driver is available when no other I2C devices are used.</p>
<h1><a class="anchor" id="Install"></a>
Installation</h1>
<p><a class="el" href="class_s_s_d1306_ascii.html" title="SSD1306 base class. ">SSD1306Ascii</a> can be installed using the library manager. Newer untagged versions may be available on GitHub.</p>
<p>You can manually install the SSD1306Ascii library by copying the SSD1306Ascii folder from the download package to the Arduino libraries folder in your sketch folder.</p>
<p>See the Manual installation section of this guide.</p>
<p><a href="http://arduino.cc/en/Guide/Libraries">http://arduino.cc/en/Guide/Libraries</a></p>
<p>The library will be added to the Arduino Library Manager soon.</p>
<h1><a class="anchor" id="Scroll"></a>
Scroll Mode</h1>
<p>Scroll mode causes the display to scroll up when a new line is written to the display.</p>
<p>Scroll mode is configured by editing <a class="el" href="_s_s_d1306_ascii_8h.html" title="Base class for ssd1306 displays. ">SSD1306Ascii.h</a>.</p>
<p>If <a class="el" href="_s_s_d1306_ascii_8h.html#ac0de102de39ccaab02096339b6ea9ec3">INCLUDE_SCROLLING</a> is defined to be zero, new line will not scroll the display and code for scrolling will not be included. This option will save some code space and several bytes of RAM.</p>
<p>If <a class="el" href="_s_s_d1306_ascii_8h.html#ac0de102de39ccaab02096339b6ea9ec3">INCLUDE_SCROLLING</a> is non-zero, the scroll feature will be included.</p>
<p>Call <a class="el" href="class_s_s_d1306_ascii.html#aff6c1dee783c665194d5eff6a1881e6a" title="Set scroll mode. ">SSD1306Ascii::setScrollMode()</a> to change the scrolling mode.</p>
<p>The initial scroll mode is define by <a class="el" href="_s_s_d1306_ascii_8h.html#a0d9ee90aff33dec356c3f4a059618bac">INITIAL_SCROLL_MODE</a> in <a class="el" href="_s_s_d1306_ascii_8h.html" title="Base class for ssd1306 displays. ">SSD1306Ascii.h</a></p>
<p>Scroll mode One of the following.</p>
<p><a class="el" href="_s_s_d1306_ascii_8h.html#a9e96f01e8966e1c609a12489b5b87f64">SCROLL_MODE_OFF</a> - newline will not scroll the display or RAM window.</p>
<p><a class="el" href="_s_s_d1306_ascii_8h.html#affb0995026a742d33c297184db344563">SCROLL_MODE_AUTO</a> - newline will scroll both the display and RAM windows.</p>
<p><a class="el" href="_s_s_d1306_ascii_8h.html#ac549e6e69b35e18d538234eb4dc09f67">SCROLL_MODE_APP</a> - newline scrolls the RAM window. The app scrolls the display window.</p>
<p>The <a class="el" href="class_s_s_d1306_ascii.html#adbe509084bf81c4e31392a726c76c4a3" title="Clear the display and set the cursor to (0, 0). ">SSD1306Ascii::clear()</a> call will erase the display and start at the top of the display.</p>
<p>See the ScrollSpi and ScrollWire examples.</p>
<p>More advanced scrolling can be implemented using member functions such as <a class="el" href="class_s_s_d1306_ascii.html#a97ea2d9d54bbea6be06ec135720dee98" title="Scroll the Display window. ">SSD1306Ascii::scrollDisplay()</a>, <a class="el" href="class_s_s_d1306_ascii.html#a163f89185df51d03ab08514607d70278" title="Scroll the RAM window. ">SSD1306Ascii::scrollMemory()</a>, and <a class="el" href="class_s_s_d1306_ascii.html#aa1a6e675534842911bb7080e39edbdee">SSD1306Ascii::scrollIsSynced()</a>.</p>
<p>Knowledge of the SSD1306 is useful for understanding advanced scrolling. See the SSD1306 data sheet. <br />
 </p>
<h1><a class="anchor" id="Fonts"></a>
Fonts</h1>
<p>Fonts are defined by .h files in the SSD1306Ascii/src/fonts folder. The fonts folder contains all fonts from openGLCD plus a number of extra fonts.</p>
<p>To select a font, call the <a class="el" href="class_s_s_d1306_ascii.html#a1129bcc81e4a46a32a01825b7b8a5cf3" title="Set the current font. ">SSD1306Ascii::setFont()</a> member function like this. </p><div class="fragment"><div class="line"><span class="comment">// Select the font used in the Adafruit GFX Graphics Library.</span></div><div class="line">oled.setFont(Adafruit5x7); </div></div><!-- fragment --><p> Only fonts referenced in your program will be loaded into flash.</p>
<p>Here are symbols for fixed width fonts. </p><pre class="fragment">Adafruit5x7
cp437font8x8
fixed_bold10x15
fixednums15x31
fixednums7x15
fixednums8x16
font5x7
font8x8
lcd5x7
lcdnums12x16
lcdnums14x24
newbasic3x5
Stang5x7
System5x7
Wendy3x5
X11fixed7x14
X11fixed7x14B
ZevvPeep8x16  
</pre><p>Here are symbols for proportional fonts. Note that Iain5x7 and utf8font10x16 are proportional. </p><pre class="fragment">Arial14
Arial_bold_14
CalBlk36
CalLite24
Callibri10
Callibri11
Callibri11_bold
Callibri11_italic
Callibri14
Callibri15
Cooper19
Cooper21
Cooper26
Corsiva_12
Iain5x7
Roosewood22
Roosewood26
TimesNewRoman13
TimesNewRoman13_italic
TimesNewRoman16
TimesNewRoman16_bold
TimesNewRoman16_italic
utf8font10x16
Verdana12
Verdana12_bold
Verdana12_italic
Verdana_digits_24
</pre><p>See <a class="el" href="all_fonts_8h.html" title="Font definitions. ">allFonts.h</a> for more information on adding a font.</p>
<p>The <a class="el" href="class_s_s_d1306_ascii.html#a37623fdc8396b3054ae14f66e47dbd30" title="Set the character magnification factor to two. ">SSD1306Ascii::set2X()</a> call doubles the size of characters. Each pixel becomes a 2x2 square. To return to standard size characters call <a class="el" href="class_s_s_d1306_ascii.html#a3c0182f72bb352c3bbeeeff4f42bf253" title="Set the character magnification factor to one. ">SSD1306Ascii::set1X()</a>; </p><div class="fragment"><div class="line">oled.set2X();</div><div class="line"><span class="comment">// Display double height and width characters.</span></div><div class="line"></div><div class="line">...</div><div class="line"></div><div class="line"><span class="comment">// Return to standard size.</span></div><div class="line">oled.set1X();</div></div><!-- fragment --><h1><a class="anchor" id="config"></a>
SSD1306Ascii Configuration</h1>
<p>Several configuration options may be changed by editing the <a class="el" href="_s_s_d1306_ascii_8h.html" title="Base class for ssd1306 displays. ">SSD1306Ascii.h</a> file in the SSD1306Ascii/src folder.</p>
<p>These options are at the start of the file.</p>
<div class="fragment"><div class="line"><span class="comment">// Configuration options.</span></div><div class="line"><span class="comment">/* Set Scrolling mode for new line.</span></div><div class="line"><span class="comment">  </span></div><div class="line"><span class="comment"> * If INCLUDE_SCROLLING is defined to be zero, new line will not scroll</span></div><div class="line"><span class="comment"> * the display and code for scrolling will not be included.  This option</span></div><div class="line"><span class="comment"> * will save some code space and three bytes of RAM.</span></div><div class="line"><span class="comment">  </span></div><div class="line"><span class="comment"> * If INCLUDE_SCROLLING is nonzero, the scroll feature will included.</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="preprocessor">#define INCLUDE_SCROLLING 1</span></div><div class="line"></div><div class="line"><span class="comment">/* Initial scroll mode, SCROLL_MODE_OFF, SCROLL_MODE_AUTO, or SCROLL_MODE_APP.*/</span></div><div class="line"><span class="preprocessor">#define INITIAL_SCROLL_MODE SCROLL_MODE_OFF</span></div><div class="line"></div><div class="line"><span class="comment">/* Use larger faster I2C code. */</span></div><div class="line"><span class="preprocessor">#define OPTIMIZE_I2C 1</span></div></div><!-- fragment --><h1><a class="anchor" id="Documentation"></a>
Documentation</h1>
<p>Please see the Classes tab for more information.</p>
<p>For I2C displays using the wire library Wire see the <a class="el" href="class_s_s_d1306_ascii_wire.html" title="Class for I2C displays using Wire. ">SSD1306AsciiWire</a> class.</p>
<p>For I2C displays using the small <a class="el" href="class_avr_i2c.html" title="Hardware I2C master class for AVR. ">AvrI2c</a> class see the <a class="el" href="class_s_s_d1306_ascii_avr_i2c.html" title="Class for I2C displays on AVR. ">SSD1306AsciiAvrI2c</a> class.</p>
<p>For SPI displays connected to the Arduino hardware SPI pins see the <a class="el" href="class_s_s_d1306_ascii_spi.html" title="Class for SPI displays on the hardware SPI bus. ">SSD1306AsciiSpi</a> class.</p>
<p>See the <a class="el" href="class_s_s_d1306_ascii_soft_spi.html" title="Class for SPI displays using software SPI. ">SSD1306AsciiSoftSpi</a> class for use of Software SPI.</p>
<h1><a class="anchor" id="comment"></a>
Bugs and Comments</h1>
<p>If you wish to report bugs or have comments, open an issue on GitHub or send email to <a href="#" onclick="location.href='mai'+'lto:'+'fat'+'16'+'lib'+'@s'+'bcg'+'lo'+'bal'+'.n'+'et'; return false;">fat16<span style="display: none;">.nosp@m.</span>lib@<span style="display: none;">.nosp@m.</span>sbcgl<span style="display: none;">.nosp@m.</span>obal<span style="display: none;">.nosp@m.</span>.net</a>. If possible, include a simple program that illustrates the bug or problem.</p>
<h1><a class="anchor" id="ExampleS"></a>
Examples</h1>
<p>A number of examples are provided in the SSD1306Ascii/examples folder.</p>
<p>To access these examples from the Arduino development environment go to: File -&gt; Examples -&gt; SSD1306Ascii -&gt; &lt;program Name&gt;</p>
<p>Compile and upload to your Arduino to run the example. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Sep 7 2019 06:47:25 for SSD1306Ascii by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
